﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EBAYVN.Dao;
using EBAYVN.DOMAIN;
using EBAYVN.Util;
namespace EBAYVN.CUSTOMERS.Pages
{
    public partial class LichTrinhDetails : System.Web.UI.Page
    {
        private LichTrinhDao ltrDao = new LichTrinhDao();
        protected void Page_Load(object sender, EventArgs e)
        {
            Page.ResolveUrl("Pages/Default.aspx");
            if (!IsPostBack)
            {
                LoadReference();
            }
        }
        protected void LoadReference()
        {
            if (Request.QueryString.Get(Sessionkey.Id_LICHTRINH) != null)
            {

                var id = Request.QueryString.Get(Sessionkey.Id_LICHTRINH);
                var ltr = new LichTrinhDao().Get(id);
                
                if (ltr != null)
                {
                    List<LICHTRINH> list = new List<LICHTRINH>();
                    list.Add(ltr);
                    rpLichTrinh.DataSource = list;
                    rpLichTrinh.DataBind();
                }
            }
            else
            {
                var listLtr = ltrDao.GetListIsNotRegistri();
                rpLichTrinh.DataSource = listLtr;
                rpLichTrinh.DataBind();
            }
        }
    }
}
